package com.xoa.dev.efficiency.controller;

import com.xoa.dev.efficiency.model.FlowPara;
import com.xoa.dev.efficiency.model.ModifyPwd;
import com.xoa.dev.efficiency.service.FlowParaService;
import com.xoa.util.ToJson;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/FlowPara")   //   /FlowSettingHoliday/index

public class FlowParaController {
    @Resource
    private FlowParaService flowParaService;

    @RequestMapping("/index")
    public String address() {
        return "app/dev/efficiency/setting/flowpara";
    }

    @RequestMapping("/selectFlowPara")
    @ResponseBody
    public ToJson<FlowPara>  selectFlowPara(FlowPara flowPara,HttpServletRequest request) {
        return flowParaService.selectFlowPara(flowPara);
    }

    @RequestMapping("/updateByPrimaryKey")
    @ResponseBody
    public ToJson updateByPrimaryKey(FlowPara flowPara,HttpServletRequest request){
        return flowParaService.updateByPrimaryKey(flowPara);
    }

    @RequestMapping("/modifyPwd")
    @ResponseBody
    public ToJson<FlowPara> modifyPwd(ModifyPwd modify,HttpServletRequest request){
        return flowParaService.modifyPwd_1(modify);
    }

    @RequestMapping("/logincheck")
    @ResponseBody
    public ToJson<FlowPara> logincheck(String pwd,HttpServletRequest request){
        return flowParaService.logincheck_1(pwd,request);
    }


    @RequestMapping("/modify")
    @ResponseBody
    public ToJson modify(String jsonStr,HttpServletRequest request){
        return flowParaService.modify(jsonStr);
    }


    @RequestMapping("/selectFlowParaByQuan")
    @ResponseBody
    public ToJson<FlowPara>  selectFlowParaByQuan() {
        return flowParaService.selectFlowParaByQuan();
    }

    @RequestMapping("/settingFlowId")
    @ResponseBody
    public ToJson settingFlowId(@RequestParam(value = "flowIdF")String flowIdF,
                                @RequestParam(value = "flowIdS") String flowIdS ){
        return flowParaService.settingFlowId(flowIdF,flowIdS);
    }

}